(rmail-dont-reply-to): Anchor user login
authorEli Zaretskii <eliz@is.elta.co.il>
Mon, 16 Feb 2004 11:42:10 +0000 (11:42 +0000)
committerEli Zaretskii <eliz@is.elta.co.il>
Mon, 16 Feb 2004 11:42:10 +0000 (11:42 +0000)
name and email address at the beginning and end of the address.

lisp/mail/mail-utils.el

index e60e8358de94036686861df60ed3d3e98a429734..96a57b38f078d53141374fa5978f5ce18dec5d34 100644 (file)
@@ -227,9 +227,15 @@ the comma-separated list.  The pruned list is returned."
                       "")
                     (if (and user-mail-address
                              (not (equal user-mail-address user-login-name)))
-                        (concat (regexp-quote user-mail-address) "\\|")
+                       ;; Anchor the login name and email address so
+                       ;; that we don't match substrings: if the
+                       ;; login name is "foo", we shouldn't match
+                       ;; "barfoo@baz.com".
+                        (concat "\\`"
+                               (regexp-quote user-mail-address)
+                               "\\'\\|")
                       "")
-                    (concat (regexp-quote user-login-name) "\\>"))))
+                    (concat "\\`" (regexp-quote user-login-name) "@"))))
   ;; Split up DESTINATIONS and match each element separately.
   (let ((start-pos 0) (cur-pos 0)
        (case-fold-search t))